import * as http from "http";

type Send<ResBody = any, T = Response<ResBody>> = (body?: ResBody) => T;

interface Response<
  ResBody = any,
  Locals extends Record<string, any> = Record<string, any>,
  StatusCode extends number = number
> {
  status(code: StatusCode): this;
  send: Send<ResBody, this>;
  // send: (body?: ResBody) => this;
}

const response: Response = {
  status(code: number): Response {
    return response;
  },
  send(body: any): Response {
    return response;
  }
};
response.status(200);

type RemoveTail<
  S extends string,
  Tail extends string
> = S extends `${infer P}${Tail}` ? P : S;
let removeTail: RemoveTail<"/showFood/:foodname/:address", "/:address">;

export {};
